OpenBuildings GenerativeComponents Help

Lists

Parameters labeled with (repl.) allow the use of lists as inputs, effectively replicating the node that they define. If there are brackets [] it indicates a one-dimensional list of the type that is required. A two-dimensional list is represented by two sets of square brackets [][].

For instance, instead of a single value for the XTranslation parameter of a Point.ByCartesianCoordinates there will be as many point instances as there are values in the list.

The syntax for a list of rank one in OpenBuildings™ GenerativeComponents is:

{1, 3, 5, 7}

Nested lists are constructed using lists of lists producing a two-dimensional data structure.

{{1, 3, 5, 7}, {4, 6 7}}

Lists are similar to arrays but they are more flexible because they do not require equal numbers of rows but allow for heterogeneous combinations of values. For instance {2 , {3,4,5}} is possible with a list type but not with an array type.

An example where a list is necessary as an input occurs with a BSplineCurve.ByPoles, which requires a one-dimensional list of points, or any object that implements the IPoint interface indicated by IPoint[] (repl). Here, the input will look like the following:

{point01, point02, point03}

A BSplineSurface.ByPoles requires a two dimensional list of points indicated by IPoint[][] (repl). Thus the input must look like the following:

{{point01, point02, point03},{point04, point05, point06}}

The list of points can extend as far as needed in the second dimension, and will be valid inputs as long as the points exist.

{{point01, point02, point03},{point04, point05, point06},{point07, point08, point09},{point10, point11, point12}}

In the image below, if the XTranslation parameter of point01 is set to a list of values instead of a single value, then the node will be replicated for each x value in the list. It is still referred to by its original name point01, but now this name refers to a list of points.

XTranslation = {1, 3, 5, 7}

XTranslation = {1,3,5,7}

This is a powerful concept and essentially a form of built-in scripting that happens behind the scenes in OpenBuildings™ GenerativeComponents. OpenBuildings™ GenerativeComponents interprets the list of values provided for any variable input with the (repl.) indicator as a command to replicate the nodes as many times as there are values in the list, each node being an instance with the respective value from the list, while sharing the remaining non-list parameters.